# Stage 1: Base Image (Python)
FROM python:3.9-bullseye

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /app

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install Playwright browser dependencies and browsers
RUN playwright install-deps
RUN playwright install

# Copy the rest of the application source code
COPY . .

# Expose the port the app runs on
EXPOSE 8036

# Run the application with Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8036", "app:app"] 